﻿@model OnlineEducation.Data.Entities.Lesson
@{
    Layout = null;
}



<div class="modal-header">
    <h4 class="modal-title">新增课时</h4>
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>

<form onsubmit="return SubmitForm(this,'/Course/Lesson/Add')">
    <div class="modal-body p-4">
        <div asp-validation-summary="ModelOnly" class="text-danger"></div>
        <input type="hidden" asp-for="CourseId" />
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <span class="text-danger">*</span><label asp-for="Sequence" class="control-label"></label>
                    <input asp-for="Sequence" class="form-control" placeholder="输入序号" />
                    <span asp-validation-for="Sequence" class="text-danger"></span>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <span class="text-danger">*</span><label asp-for="Title" class="control-label"></label>
                    <input asp-for="Title" class="form-control" placeholder="输入标题" />
                    <span asp-validation-for="Title" class="text-danger"></span>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label asp-for="Duration" class="control-label"></label>
                    <input asp-for="Duration" class="form-control" placeholder="请输入时长" />
                    <span asp-validation-for="Duration" class="text-danger"></span>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label asp-for="Chapter" class="control-label"></label>
                    <input asp-for="Chapter" class="form-control" placeholder="请输入章名" />
                    <span asp-validation-for="Chapter" class="text-danger"></span>
                </div>
            </div>
       
            <div class="col-md-6">
                <div class="form-group">
                    <label asp-for="Section" class="control-label"></label>
                    <input asp-for="Section" class="form-control" placeholder="请输入节名" />
                    <span asp-validation-for="Section" class="text-danger"></span>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label asp-for="Description" class="control-label"></label>
                    <textarea asp-for="Description" class="form-control" placeholder="请输入描述" rows="3"></textarea>
                    <span asp-validation-for="Description" class="text-danger"></span>
                </div>
            </div>
        </div>


        @*<div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label class="control-label" for="course-cover">预习课件</label>

                    <input asp-for="PreviewMaterialURLs" type="file" class="dropify" id="previewMaterial" data-height="300" data-max-file-size-preview="30M" data-default-file="@Model.PreviewMaterialURLs" />
                    <span asp-validation-for="PreviewMaterialURLs" class="text-danger"></span>
                </div>

            </div>
        </div>*@
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label class="control-label" for="course-cover">课件</label>

                    <input asp-for="MaterialURLs" type="file" class="dropify" id="material" data-height="100" data-max-file-size-preview="30M" data-default-file="@Model.MaterialURLs" />
                    <span asp-validation-for="MaterialURLs" class="text-danger"></span>
                </div>

            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">关闭</button>
        <button type="submit" class="btn btn-primary waves-effect waves-light">保存</button>
    </div>
</form>
<script>
    Ladda.bind('.btn-primary', { timeout: 1000 });
    $(function () {

        $("#material").dropify({
            messages: {
                default: "拖放一个文件到这里或者点击添加一个文件",
                replace: "拖放或者点击替换一个文件",
                remove: "删除",
                error: "Ooops, 出错了."
            },
            error: {
                fileSize: "文件尺寸太大 (最大30M).",
                imageFormat: '只允许({{ value }})文件格式.'
            }
        });


    });
</script>



